package com.wxf.web;

import com.wxf.service.GradeService;
import com.wxf.service.impl.GradeServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

@WebServlet(urlPatterns = "/Educational/student/getGradeInfo")
public class GetGradeInfoServlet extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        GradeService gradeService = new GradeServiceImpl();
        List grades = gradeService.getGradeInfo();
        if(grades!=null){
            req.setAttribute("gradeList",grades);
            req.getRequestDispatcher("add.jsp").forward(req,resp);
        }
    }
}
